// http入口
package main

import (
	"fmt"
	router "goHelpers/routes"

	"gitee.com/copylian/lian-go.git/bootstrap"
	"github.com/gin-contrib/pprof"
	"github.com/gin-gonic/gin"
)

// 端口
const ServiceHostPort = ":50051"

// 项目名称
const ProjectName = "goHelpers"

// main main函数
func main() {
	// 设置项目名称
	bootstrap.SetProjectName(ProjectName)

	// 初始化环境
	bootstrap.Init()

	// 中间件
	middleFun := []gin.HandlerFunc{
		//	middleware.CheckUserAuth(),
	}

	// 初始化gin http
	r := bootstrap.InitWeb(middleFun)

	// pprof 性能监测
	pprof.Register(r)

	// 注册路由
	router.RegisterRouter(r)

	// 监听
	fmt.Printf("Listen on%s\n", ServiceHostPort)

	// 启动
	r.Run(ServiceHostPort)
	//bootstrap.RunWeb(r, ServiceHostPort)
}
